package com.code.bolg.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IndexController {
    @Value("${sys.webPath}")
    String webPath;
    @Value("${sys.imgPath}")
    String imgPath;
    @Value("${sys.apiPath}")
    String apiPath;
    @Value("${sys.title}")
    String title;
    /**
     * @return
     * 首页
     */
    @RequestMapping({"/page/index","/index","/"})
    public String index() {
        return "html/index";
    }


    @ModelAttribute
    public void init(Model model){
        model.addAttribute("imgPath", imgPath);
        model.addAttribute("webPath", webPath);
        model.addAttribute("apiPath", apiPath);
        model.addAttribute("title", title);
    }
}
